package com.fwmagic.spark.core.action

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

/**
  * 数据集中取最小的一个
  */
object MaxDemo {
    def main(args: Array[String]): Unit = {
        val conf = new SparkConf()
                .setAppName(this.getClass.getSimpleName)
                .setMaster("local[*]")

        val sc = new SparkContext(conf)

        val rdd1: RDD[Int] = sc.makeRDD(1 to 10)

        val max: Int = rdd1.max()

        println(max)

        sc.stop()
    }
}
